﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DongleManage.Model.BaseClass;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.Data;

namespace DongleManage.Model.Common
{
    [DataContract]
    public class DictEntity:BaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        [DataMember]
        [DisplayName("主键")]
        public int TransactionNumber { get; set; }

        /// <summary>
        /// 字典代码
        /// </summary>
        [DataMember]
        [DisplayName("字典代码")]
        public string Code { get; set; }

        /// <summary>
        /// 字典名称
        /// </summary>
        [DataMember]
        [DisplayName("字典名称")]
        public string DictName { get; set; }

        public DictEntity(IDataReader dataReader)
            : base(dataReader)
        {
            TransactionNumber = Convert.IsDBNull(dataReader["TransactionNumber"]) ? 0 : int.Parse(dataReader["TransactionNumber"].ToString());
            Code = Convert.IsDBNull(dataReader["Code"]) ? "" : dataReader["Code"].ToString();
            DictName = Convert.IsDBNull(dataReader["DictName"]) ? "" : dataReader["DictName"].ToString();
        }
    }
}
